<%@page language="java" import="java.sql.*,java.text.*,java.util.*,com.ba360.portal.database.dao.*,com.ba360.portal.database.dbo.Adsdaobean"%>           
  <%    
        String subcat	  = request.getParameter("subcategory");
	String req        = request.getParameter("requesttype"); 
	String exclude    = request.getParameter("excludeword"); 
	String selectedValue = request.getParameter("selectedvalue");
	String searchword = request.getParameter("searchword");
	
	String action	     =  request.getParameter("actiontype"); 
	String actionvalue   =  request.getParameter("actionvalue"); 
	
	Adsdao   obj      = new Adsdao();	
	int result	  = obj.getCount();
	Vector v          = obj.getAllValues();	
	
	
	SimpleDateFormat informat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	SimpleDateFormat outformat= new SimpleDateFormat("MMM,dd");
	
	out.print("<table>");	
	out.print("<tr><th>Posted<br>On</th><th>Featured Postings</th><th>Sub-Category</th><th>City</th></tr>");   
	 if(req == null)      
	 {
	       for(int i=0;i<v.size();i++)
	       {
	        Adsdaobean bean =new Adsdaobean();
	        bean=(Adsdaobean)v.get(i);
	        out.print("<tr bgcolor=green ><td>"+outformat.format(informat.parse(bean.getDate()))+"</td><td >"+bean.getAdsname()+"</td><td>"+bean.getCatname()+"</td></tr>");       
	       }      
	  }
	  else if((req != null) && (req.equals("gosearch")))
	  {
	       Vector searchV = obj.getSerachQuery(searchword);	       
	       for(int j=0;j<searchV.size();j++)
	       {
	        Adsdaobean bean =new Adsdaobean();
	        bean=(Adsdaobean)searchV.get(j);
	        out.print("<tr><td>"+outformat.format(informat.parse(bean.getDate()))+"</td><td >"+bean.getAdsname()+"</td><td>"+bean.getCatname()+"</td></tr>");       
	       }    
	  }
	  else if((req != null) && (req.equals("excludeword")))
	  {
	       Vector excludeV = obj.getExcludeWords(exclude);	       
	       for(int k=0;k<excludeV.size();k++)
	       {
	        Adsdaobean bean =new Adsdaobean();
	        bean=(Adsdaobean)excludeV.get(k);
	        out.print("<tr><td>"+outformat.format(informat.parse(bean.getDate()))+"</td><td >"+bean.getAdsname()+"</td><td>"+bean.getCatname()+"</td></tr>");       
	       }	
	  }
	  else if((req != null) && (req.equals("subcat")))
	  {
	       Vector subcatV = obj.subCategoryResult(subcat);	       
	       for(int z=0;z<subcatV.size();z++)
	       {
	        Adsdaobean bean =new Adsdaobean();
	        bean=(Adsdaobean)subcatV.get(z);
	        out.print("<tr><td>"+outformat.format(informat.parse(bean.getDate()))+"</td><td >"+bean.getAdsname()+"</td><td>"+bean.getCatname()+"</td></tr>");       
	       }    
	  }	 
	out.print("</table>");
%>